package com.hkzhao.shixun.component;

import com.hkzhao.shixun.service.DrawsLotteryService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * <h3>j2ee</h3>
 * <p>消息的消费者 用来删中奖记录</p>
 *
 * @author : hkzhao
 * @date : 2020-06-06 18:05
 **/
@Component
@RabbitListener(queues = "cvte.user.cancleLottery")
public class CancleLotteryRecordReceiver {
    private static final Logger LOGGER = LoggerFactory.getLogger(CancleLotteryRecordReceiver.class);
    @Autowired
    private DrawsLotteryService drawsLotteryService;
    @RabbitHandler
    public void handle(String recordId){
        LOGGER.info("删除没有超期填写信息的中奖者记录:{}",recordId);
        drawsLotteryService.deleteLotteryRecord(recordId);
    }
}
